using System.Linq;
using Common;

namespace SSettings.ExperimentColumn
{
	public class MeltColumns : AQColumns
	{
		protected override void InitCustomColumn()
		{
			_Columns.Add(new ColumnInfo
			{
				FieldName = "SampleTargetItem.Result.Tm",
				Header = Utility.GetMessage("Tm"),
				Info = 2,
				AllowDelete = false,
				AllowEditing = false
			});
			_Columns.Add(new ColumnInfo
			{
				FieldName = "SampleTargetItem.Result.Rm",
				Header = Utility.GetMessage("Rm"),
				Info = 2,
				AllowDelete = false,
				AllowEditing = false
			});
			_Columns.Add(new ColumnInfo
			{
				FieldName = "SampleTargetItem.Result.Ym",
				Header = Utility.GetMessage("Ym"),
				Info = 2,
				AllowDelete = false,
				AllowEditing = false,
				Visibility = false
			});
			_Columns.Add(new ColumnInfo
			{
				FieldName = "SampleTargetItem.Result.Wm",
				Header = Utility.GetMessage("Wm"),
				Info = 2,
				AllowDelete = false,
				AllowEditing = false,
				Display = (ConfigReader.GetInstance().GetMeltParamVisibleFromIni() == 1)
			});
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.CnValue").FirstOrDefault().Visibility = false;
		}

		protected override GridColumns CreateColumns()
		{
			return new MeltColumns();
		}

		public override void SetVisibilityDefault()
		{
			base.SetVisibilityDefault();
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.CnValue").FirstOrDefault().Visibility = false;
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.Wm").FirstOrDefault().Visibility = false;
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.Ym").FirstOrDefault().Visibility = false;
		}
	}
}
